// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'
import HappyScroll from 'vue-happy-scroll'
import 'vue-happy-scroll/docs/happy-scroll.css'
import 'element-ui/lib/theme-chalk/index.css';
import 'wowjs/css/libs/animate.css'
import './assets/css/css.css'
import './assets/css/reset.css'
import './mixin'
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
Vue.use(VideoPlayer)

import foot from '@/components/foot'
import heads from '@/components/heads'
Vue.component('foot', foot);
Vue.component('heads', heads);

import VueI18n from "vue-i18n";
Vue.use(VueI18n);

import ch from './assets/languages/ch'
import ch2 from './assets/languages/ch2'
import en from './assets/languages/en'
import enLocale from 'element-ui/lib/locale/lang/en'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import zh2Locale from 'element-ui/lib/locale/lang/zh-TW'
zhLocale.el.datepicker.today = '本月'
zh2Locale.el.datepicker.today = '本月'
enLocale.el.datepicker.today = 'Now'
console.log('zhLocale',zhLocale)
const i18n = new VueI18n({
  locale: !localStorage.getItem("lang")
    ? "en"
    : localStorage.getItem("lang"),
  messages: {
    'ch': {
      ...ch,
      ...zhLocale
    },  // 本地资源文件，配2个语言，中文&英文，src下根据个人情况放置
    'en': {
      ...en,
      ...enLocale
    },
    'ch2': {
      ...ch2,
      ...zh2Locale
    }
  },
  silentTranslationWarn: true
});
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})
// import waicTabs from '@/components/tabs'
// Vue.component('waic-tabs', waicTabs)

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.use(VueAwesomeSwiper)
Vue.use(HappyScroll)
Vue.prototype.i18n = i18n;

/* eslint-disable no-new */
new Vue({
  el: '#app',
  i18n,
  store,
  router,
  components: { App },
  template: '<App/>'
})
